package com.ajk.server.dao;
import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;

import com.ajk.server.dao.provider.PatientEventCategoryDictProvider;
import com.ajk.server.model.PatientEventCategoryDict;
import com.ajk.server.model.query.PatientEventCategoryDictQuery;
/**
 * 数据类型  <br>
 * dict_patient_event_category <br>
 * v1.0 2016-05-01
 */
 public interface PatientEventCategoryDictMapper {
 	
 	/**
 	*根据id删除 数据类型
 	*/
 	@Delete("delete from dict_patient_event_category where id=#{id}")
 	public Integer deleteById(Integer id);
 	
 	/**
 	* 批量新增 数据类型
 	*/
 	@InsertProvider(method="batchInsert",type=PatientEventCategoryDictProvider.class)
	@Options(useGeneratedKeys=true,keyColumn="id",keyProperty="list[0].id")
 	public Integer batchInsert(List<? extends PatientEventCategoryDict> patientEventCategoryDicts);
 	
 	/**
 	* 新增 数据类型
 	*/
 	@InsertProvider(method="insert",type=PatientEventCategoryDictProvider.class)
	@Options(useGeneratedKeys=true)
 	public Integer insert(PatientEventCategoryDict domain);
 
 	
 	/**
 	*更新 数据类型
 	*/
 	@UpdateProvider(method="update",type=PatientEventCategoryDictProvider.class)
 	public Integer update(PatientEventCategoryDict domain);
 	
 	/**
 	*根据ID查询 数据类型
 	*/
	@Select("select * from dict_patient_event_category where id=#{id}")
	public PatientEventCategoryDict findById(Integer id);
	
	/**
 	*通过query 查询 数据类型
 	*/
 	@SelectProvider(method="findByQuery",type=PatientEventCategoryDictProvider.class)
 	public List<PatientEventCategoryDict> findByQuery(PatientEventCategoryDictQuery query);
 	
 	/**
 	*通过query count总条数
 	*/
 	@SelectProvider(method="countByQuery",type=PatientEventCategoryDictProvider.class)
 	public Integer countByQuery(PatientEventCategoryDictQuery query);
 	
 	/**
 	* 通过ids查询
 	*/
 	@SelectProvider(method="findByIds",type=PatientEventCategoryDictProvider.class)
 	public List<PatientEventCategoryDict> findByIds(List<Integer> ids);
 	
 	 /**
 	*根据name查询 数据类型
 	*/
	@Select("select * from dict_patient_event_category where name=#{name} limit 1")
	public PatientEventCategoryDict findByName(String name);
	
	/**
 	*获取所有字典 数据类型
 	*/
	@Select("select * from dict_patient_event_category")
	public List<PatientEventCategoryDict> findAll();
	

}	